package com.hoshiicloud.elasticsearch.repository;


import com.hoshiicloud.elasticsearch.entity.Spu;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;

/**
 * spu ES操作类
 */
public interface SpuRepository extends ElasticsearchRepository<Spu, Long> {
    /**
     * 搜索查询
     *
     * @param title     商品名称
     * @param page      分页信息
     * @return
     */
    Page<Spu> findByTitleAndStoreId(String title, Long storeId, Pageable page);

    /**
     * 根据店铺ID查询列表
     * @param storeId 店铺id
     * @param page    分页
     * @return Page<Spu>
     */
    Page<Spu> findByStoreId(Long storeId, Pageable page);
}
